/* 
 * File:   MPISlave.h
 * Author: alexander
 *
 * Created on July 28, 2011, 5:17 PM
 */

#ifndef MPISLAVE_H
#define	MPISLAVE_H

#include <stdio.h>
#include "../libGRASP/MGrasp.h"
#include "../libBFGS/ap.h"


#define PURO 	0
#define HIBRIDO 1
#define BFGS 	2

class MPISlave {
public:
    MPISlave(int rank, Funcao *func, LBFGS *lbfgs, double maxiters, int type, int n, int m, int info, double epsg, double epsf, double epsx, int maxEvals, ap::real_1d_array xBFGS, MGrasp *mgrasp);
    MPISlave(const MPISlave& orig);
    virtual ~MPISlave();
    void start();
private:
    double *x;
    int *evals;
    int m, info, n;
    int maxEvals;
    MGrasp *mgrasp;
    int rank;
    int type;
    ap::real_1d_array xBFGS;
    double epsg, epsf, epsx;
    Funcao *func;
    LBFGS *lbfgs;
    double maxiters;
};

#endif	/* MPISLAVE_H */

